﻿using QueuesLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QueuesClients {
    public abstract class QueuesClient<TClient,I> where TClient : System.ServiceModel.ClientBase<I> where I : class {
        protected TClient proxy;
        private string id, ipAddress, port, endAddr;

        public QueuesClient(string id, string ipAddress, string port, string endAddr) {
            Id = id;
            this.ipAddress = ipAddress;
            this.port = port;
            this.endAddr = endAddr;
        }

        public abstract TClient Proxy { get; }

        public string Id {
            get { return id; }
            set { id = value; }
        }

        public string Url {
            get {
                return "http://" + ipAddress + ":" + port + "/" + endAddr;
            }
        }
    }
}
